<?php
/* @var $this AskReplyController */
/* @var $model AskReply */
/* @var $form CActiveForm */
?>

<?php
//生成渲染UEditor的js
/*Yii::app()->getClientScript()->registerScript("UEditor", "var editor = new UE.ui.Editor({toolbars: [['insertimage', 'emotion', 'scrawl']], initialFrameHeight: 200});
                                                                            editor.render('AskReply_body_floor');

                                                                            $('#ask-reply-form').on('click', '[type=\"submit\"]', function() {
                                                                                $('#ask-reply-form #AskReply_body').text(editor.getContent());
                                                                        });"
                                                                        );*/
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'ask-reply-form',
	// Please note: When you enable ajax validation, make sure the corresponding
	// controller action is handling ajax validation correctly.
	// There is a call to performAjaxValidation() commented in generated controller code.
	// See class documentation of CActiveForm for details on this.
//	'enableAjaxValidation'=>true,
                     'clientOptions' => array(
                            'validateOnSubmit' => true,
                        ),
                     'enableClientValidation'=>true,
)); ?>

	<div class="row">
		<?php echo $form->textArea($model,'body',array('rows'=>6, 'cols'=>50,'id'=>'AskReplyDown_body')); ?>
        <script type="text/javascript">
			var editor = new UE.ui.Editor({toolbars:[['insertimage', 'emotion', 'scrawl']], initialFrameHeight:200});
			editor.render("AskReplyDown_body");
		</script>
		<?php echo $form->error($model,'body'); ?>
	</div>

                     <div class="row">
                                         <?php if (CCaptcha::checkRequirements()): ?>
                                                        <div>
                                                            <?php echo $form->labelEx($model, 'verifyCode'); ?>
                                                            <div>
                                                                <?php echo $form->textField($model, 'verifyCode'); ?>
                                                                <?php $this->widget('CCaptcha', array(
                                                                                'clickableImage'=>true,
                                                                                'showRefreshButton'=>false,
                                                                )); ?>
                                                            </div>
                                                        </div>
                                                        <?php echo $form->error($model, 'verifyCode'); ?>
                                           <?php endif; ?>
                     </div>
	<div class="row buttons">
		<?php echo CHtml::submitButton(Yii::t('ask/views', 'Reply'), array('class'=>'btn btn-primary')); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->
